{extends file="index.tpl"}
{block name="page-content"}
    <div class="row-fluid">
        <div class="span12">
            <div class="block">
                <div class="head">
                    <h2>Chỉnh Sửa Game</h2>
                    <ul class="buttons">
                        <li>
                            <a href="#" onClick="source('form_validation'); return false;">
                                <div class="icon"><span class="ico-info"></span></div>
                            </a>
                        </li>
                    </ul>
                </div>
                <form id="validate" method="POST" action="{$WEB_BASE_URL}/index.php?controller=game&action=update&database={$data}&id={$game.id}">
                	<input type="hidden" name="id" value="{$game.id}" />
                    <div class="data-fluid">
                        <div class="row-form">
                            <div class="span2">Loại Game</div>
                            <div class="span10">
                                <select name="loaigame" class="select" style="width: 100%;">
                                        <option value="2" {if $loaiGame eq 'online'} Selected {/if}>Game Online</option>
                                        <option value="3" {if $loaiGame eq 'offline'} Selected {/if}>Game Offline</option>
                                        <option value="4" {if $loaiGame eq 'webgame'} Selected {/if}>Game Web</option>
                                         <option value="156" {if $loaiGame eq 'online'} Selected {/if}>Game Mod</option>
                                        <option value="78" {if $loaiGame eq 'kinhdien'} Selected {/if}>Game Kinh Điển</option>
                                </select>
                            </div>
                        </div>
                       <!--  <div class="row-form">
							<div class="span2">Kiểu Game Kinh Điển</div>
							<div class="span10">
								<select name="kieugame" class="select" style="width: 100%;">
									<option value="0" >--Chọn kiểu game kinh điển--</option>
									{foreach from=$gamekinhdienArr item=gamekinhdien}
									<option value="{$gamekinhdien.name}" {if $kieugameKD eq $gamekinhdien.unique_name|replace:'-':''} Selected {/if}>{$gamekinhdien.name}</option>
                                    {/foreach}
								</select>
							</div>
						</div> -->
                        <div class="row-form">
                            <div class="span2">Parent:</div>
                            <div class="span10">
                                <select name="parent" class="select" style="width: 100%;">
                                    <option value="0">----Chọn Parent----</option>
                                    <option value="156" {if $game.parent eq '156' } Selected {/if}>Game Mod</option>
                                    {foreach from=$gameCategoryArr item=gameCategory}
                                        <option value="{$gameCategory.id}" {if $gameCategory.id eq $game.parent } Selected {/if}>{$gameCategory.name}</option>
                                    {/foreach}

                                </select>
                            </div>
                        </div>
                        <div class="row-form">
                            <div class="span2">Name</div>
                            <div class="span10">
                                <input type="text" class="validate[required]" name="name" value='{$game.name|stripslashes}' />
                                <span class="bottom">Required</span>
                            </div>
                        </div>

                        <div class="row-form">
                            <div class="span2">Medium Name</div>
                            <div class="span10">
                                <input type="text" class="validate[required]" name="mediumName" value='{$game.mediumName|stripslashes}'/>
                                <span class="bottom">Required</span>
                            </div>
                        </div>
                        <div class="row-form">
                            <div class="span2">Unique Name</div>
                            <div class="span10">
                                <input type="text" class="validate[required]" name="unique_name" value="{$game.unique_name}"/>
                                <span class="bottom">Required</span>
                            </div>
                        </div>
                        <div class="row-form">
							<div class="span2">Type</div>
							<div class="span3">
                             	<input type="radio" class="validate[required]" {if $game.type eq 1}checked="checked"{/if} name="type" value="1"/> Event
                             	<input type="radio" class="validate[required]" {if $game.type eq 2}checked="checked"{/if} name="type" value="2"/> Hướng dẫn
                          	</div>
						</div>
                        <div class="row-form">
                            <div class="span2">SEO Name</div>
                            <div class="span10">
                                <input type="text" name="SEO_Name" value="{$game.SEO_Name}"/>
                            </div>
                        </div>
                        <div class="row-form">
                            <div class="span2">Image</div>
                            <div class="span10">
                                <input type="text" class="validate[required]" name="image" value="{$img}"/>
                                <span class="bottom">Required</span>
                            </div>
                        </div>
                        <div class="row-form">
                            <div class="span2">XLarge Image</div>
                            <div class="span10">
                                <input type="text" class="validate[required]" name="xlargeImage" value="{$imgx}"/>
                                <span class="bottom">Required</span>
                            </div>
                        </div>
                        <div class="row-form">
                            <div class="span2">Sort Detail</div>
                            <div class="span10"><textarea name="shortDetail" placeholder="Placeholder example" class="validate[required]">{$game.shortDetail|stripslashes}</textarea></div>
                        </div>
                        <div class="row-form">
                            <div class="span2">Medium Detail</div>
                            <div class="span10"><textarea name="mediumDetail" placeholder="Placeholder example" class="validate[required]">{$game.mediumDetail|stripslashes}</textarea></div>
                        </div>
                        <div class="row-form">
                            <div class="span2">SEO_metaDescription</div>
                            <div class="span10"><textarea name="SEO_metaDescription" placeholder="Placeholder example" class="validate[required]">{$game.SEO_metaDescription}</textarea></div>
                        </div>
                        <div class="row-form">
                            <div class="span2">SEO_keyword</div>
                            <div class="span10"><input name="SEO_keyword" type="text" class="tags" value="{$game.SEO_keyword}"/></div>
                        </div>
                        <div class="block">
                            <div class="head green">
                                <h2>Long Detail</h2>
                            </div>
                            <textarea id="elrte" name="longDetail" cols="auto" rows="auto"  style="height: 500px !important">{$game.longDetail|stripslashes}</textarea>
                        </div>
                        <div class="row-form">
                            <div class="span2">Satus</div>
                            <div class="span10">
                                <select name="status" class="select" style="width: 100%;">
                                    <option value="1" {if $game.status eq 1 } Selected {/if}>Hiện</option>
                                    <option value="0" {if $game.status eq 0 } Selected {/if}>Ẩn</option>
                                </select>
                            </div>
                        </div>
                        <div class="row-form">
                            <div class="span2">Order Game</div>
                            <div class="span10">
                                <input type="text" name="order" class="validate[custom[integer]]" value="{$game.order}"/>
                            </div>
                        </div>
                        <div class="row-form">
                            <div class="span2">Hot Star:</div>
                            <div class="span10">
                                <select name="hot_star" class="select" style="width: 100%;">
                                    <option value="0" {if $game.hot_star eq 0 } Selected {/if}>Ẩn</option>
                                    <option value="5" {if $game.hot_star eq 5 } Selected {/if}>Hiện</option>
                                </select>
                            </div>
                        </div>
                        <div class="row-form">
                            <div class="span2">Is Event:</div>
                            <div class="span10">
                                <select name="isEvent" class="select" style="width: 100%;">
                                    <option value="1" {if $game.isEvent eq 1 } Selected {/if}>Hiện</option>
                                    <option value="0" {if $game.isEvent eq 0 } Selected {/if}>Ẩn</option>

                                </select>
                            </div>
                        </div>
                        <div class="row-form">
                            <div class="span2">Is Game:</div>
                            <div class="span10">
                                <select name="isGame" class="select" style="width: 100%;">
                                    <option value="0" {if $game.isGame eq 0 } Selected {/if}>0</option>
                                    <option value="1" {if $game.isGame eq 1 } Selected {/if}>1</option>

                                </select>
                            </div>
                        </div>
                        <div class="row-form">
                            <div class="span2">Expire Date</div>
                            <div class="span10">
                                <input type="text" name="expire_date" class="datepicker" value="{$game.expire_date}"/>
                                <span class="bottom">date YYYY-MM-DD</span>
                            </div>
                        </div>
						<div class="row-form">
							<div class="span2">Link Canonical</div>
							<div class="span10"><textarea name="link_canonical" placeholder="Placeholder example">{$game.link_canonical}</textarea></div>
						</div>
                       <!-- 
                       <div class="row-form">
                            <div class="span2">SEO_title</div>
                            <div class="span10"><textarea name="SEO_title" placeholder="Placeholder example">{$game.SEO_title}</textarea></div>
                        </div> 
                        <div class="row-form">
                        	<div class="span2">Tag Game:</div>
							<div class="span10">
								<select name="tag1[]" multiple="multiple" class="select" style="width: 100%;">
									{foreach from=$gameTagArr item=gameTag}
                                        {assign "class" ""}
                                        {foreach from=$mang item=id}
                                            {if $gameTag.id eq $id}
                                                {$class = 'selected'}
                                            {/if}
                                        {/foreach}
                                        <option {if $class eq 'selected'}selected="$class"{/if} value="{$gameTag.id}">{$gameTag.name}</option>
                                    {/foreach}
								</select>
							</div>
						</div>-->
                        <div class="toolbar bottom tar">
                           <div class="btn-group">
                                <button class="btn btn-info" type="button" onClick="$('#validate').validationEngine('hide');">Hide prompts</button>
                                <button class="btn" type="submit">Update Game</button>
                           </div>
                        </div>
                    </div>

                </form>
            </div>
        </div>

    </div>

{/block}
